package com.yidu.t279;

import com.yidu.t279.pojo.ManageUser;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

/**
 * @author ：liandyao
 * @description：TODO
 * @date ：2020/4/22 13:35
 */
public class ManageUserTest {
    @Test
    public void update(){
        ManageUser user = new ManageUser();
        user.setId("1");
        user.setBalance(10000.0);
        user.setName("西门庆");
        user.setPwd("wp");
        user.setQx("到处跑");

        SqlSession session = App.getSqlSession();

        int rows = session.update("ManageUserMapper.update",user);
        System.out.println("操作成功"+rows);

        session.commit();

        session.close();
    }


    @Test
    public void delete(){
        SqlSession session = App.getSqlSession();

        int rows = session.update("ManageUserMapper.delete",2);
        System.out.println("操作成功"+rows);

        session.commit();

        session.close();
    }
}
